package test_package;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

/**

 * Created by IIGalytska on 31.03.14.

 */

public class HomePage {

    private WebDriver driver;

    public HomePage(FirefoxDriver driver){

        this.driver = driver;

    }

    public ResultPage search(String text){

        driver.findElement(By.xpath("//*[@id=\"body-header\"]/div[2]/div/div/div/div[2]/form/div[2]/div[1]/input")).sendKeys(text);

                driver.findElement(By.xpath("//*[@id=\"body-header\"]/div[2]/div/div/div/div[2]/form/div[1]/span/button")).click();

        return new ResultPage(driver);

    };

}